[NET] back: Added tx queue
This patch adds a tx queue to the backend if the frontend supports rx
refill notification. A queue is needed because SG/TSO greatly reduces
the number of packets that can be stored in the rx ring. Given an rx
ring with 256 entries, a maximum TSO packet can occupy as many as 18
entries, meaning that the entire ring can only hold 14 packets. This
is too small at high bandwidths with large TCP RX windows.
Having a tx queue does not present a new security risk as the queue is
a fixed size buffer just like the rx ring. So each guest can only
hold a
fixed amount of memory (proportional to the tx queue length) on the
host.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Cannot BUG_ON netbk_queue_full yet !netbk_can_queue, as this can be
triggered by a misbehaving client. Set req_event appropriately when
stopping the packet queue, or we will not receive a notification.
Signed-off-by: Keir Fraser <keir@xensource.com>